﻿using System.Collections.Generic;
using Pay.DTO;
using Pay.TO;

namespace Pay.IService {
	public interface ICategoryService {
        #region 拓垦商城
        /// <summary>
        /// 获得产品品类分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <param name="merchant_id"></param>
        /// <returns></returns>
        PagedResult<token_category_dto> GetCategoryPageList(CategoryQuery query, long merchant_id);
        /// <summary>
        /// 获取一级分类列表 0 商城 1 集市
        /// </summary>
        /// <returns></returns>
        List<token_category_dto> GetTokenFirstDepthCatagory(int type = 0);
        /// <summary>
        /// 获取拓垦的分类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        token_category_dto GetTokenCategory(long id);
        /// <summary>
        /// 新增或修改拓垦商城分类
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="merchantId"></param>
        /// <returns></returns>
        bool AddOrUpdateTokenCategory(token_category_dto dto, long merchantId);
        /// <summary>
        /// 删除拓垦商城分类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool RemoveTokenCategory(long id);
        /// <summary>
        /// 更新拓垦分类状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        bool UpdateTokenCategoryStatus(long id, int status);
        #endregion
        long Save(category_model dto);
		int Update(long id, int sort);
		int Delete(long id);
		category_dto Get(long id);
        /// <summary>
        /// 查询子类、将子类放在children中
        /// </summary>
        /// <param name="merchant_id"></param>
        /// <param name="type">0 所有 1 商城 2 集市</param>
        /// <returns></returns>
        List<category_ex> GetAll(long merchant_id, int type = 0);
		ApiResultMessage DeleteCategory(long id);
        category_dto GetCategoryByName(string name);
	}
}